/* ----------------------------------------------------------------------------
* File: file_exception.h
*
* Desc: Declaration of the CFileException class
*
* Created: 31/03/2010, by Alexey Korshunov
* ---------------------------------------------------------------------------- */
#ifndef _FILE_EXCEPTION_H_
#define _FILE_EXCEPTION_H_


/************************************************************************/
/* CFileException class for file i/o exceptions                         */
/************************************************************************/
class CFileException
{
public:
	explicit CFileException(const char *msg):
	  m_str(NULL)
	{
		if (msg != NULL)
			m_str.append(msg);
	}

	~CFileException() {}

	// Get exception message
	const std::string& GetMsg() { return m_str; }

	// Write into the output stream
	void Write(void (*output)(const char *str, ...))
	{
		output(m_str.c_str());
	}

private:
	std::string m_str;
};

#endif // _FILE_EXCEPTION_H_
